package main

import (
	"dh.com/shop/srv/log/subscriber"
	"github.com/micro/go-micro"
	"github.com/micro/go-micro/util/log"
)

func main() {
	// New Service
	service := micro.NewService(
		micro.Name("com.dh.shop.srv.log"),
		micro.Version("1.0"),
	)

	// Initialise service
	service.Init()

	// Register Struct as Subscriber
	micro.RegisterSubscriber("com.dh.shop.srv.log", service.Server(), subscriber.NewLog())

	// Run service
	if err := service.Run(); err != nil {
		log.Fatal(err)
	}
}
